<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'home.jsp' starting page</title>
    <script type="text/javascript">
        $(function(){
        	$("#dg1").datagrid({
	    		checkOnSelect:true,
	    		autoRowHeight:false,
	    		singleSelect:true,
	    		fitColumns:true,
	    		toolbar:'#tb',
	    		columns:[[
	    			{field:'jobs',title:'待处理任务',width:80,align:'center',
	    				formatter: function(value,row,index){
	    					var before = value.substring(0,2);
	    					var after = value.substring(value.indexOf('条'));
	    					var number = value.substring(2,value.indexOf('条'));
	    					return before+'<span style="color: red;">'+number+'</span>'+after;
	    				}
	    			}
	    	    ]]
	    	});
        	
        	refresh();
       })
       
       function refresh(){
        	var jsonstr = '[{"jobs":"您有5条待处理任务"}]';
        	var data = eval('(' + jsonstr + ')');
        	$('#dg1').datagrid('loadData',data);
       }
    </script>
  </head>
  
  <body>
    <div style="background-repeat: no-repeat;height:100%;width:100%; background-size: 100% 100%;">
	    <div style="height:50px;text-align: center;"><h1>银保监会现场检查分析系统</h1></div>
	    <div style="height: 300px;width: 480px;padding-top: 10px;padding-left: 10px;">
	        <div id="tb" style="padding:5px;height:auto;">
			    <a class="easyui-linkbutton" iconCls="icon-reload" onclick="refresh()">刷新</a>
	        </div>
	        
	        <table title="" id="dg1" style="height: 250px;width: 380px;"></table>
	    </div>
    </div>
  </body>
</html>
